package com.jiyun.controller;

import com.jiyun.EmployeeFeign;
import com.jiyun.pojo.Duty;
import com.jiyun.pojo.Employee;
import com.jiyun.pojo.Sector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("sector")
public class SectorController {

    @Autowired
    EmployeeFeign employeeFeign;


    @RequestMapping("findPage")
    @ResponseBody
    public List<Duty> findPage(){
        return employeeFeign.findPagesec();
    }

    @RequestMapping("del")
    public String del(Integer id){
          employeeFeign.delsec(id);
        return "sector";
    }

    @RequestMapping("show")
    public String show(){
        return "sector";
    }




    @RequestMapping("add")
    public String add(@RequestBody Sector sector){
        employeeFeign.addsec(sector);
        return "sector";
    }

    @RequestMapping("update")
    public String update(@RequestBody Duty duty){
        employeeFeign.updatesec(duty);
        return "sector";
    }
    @RequestMapping("zhiwuadd")
    public String zhiwuadd(@RequestBody Duty duty){
        employeeFeign.zhiwuadd(duty);
        return "sector";
    }

}
